Skip to content

fix: apply configured thinking levels through V2 - #279

Merged
hffmnnj merged 3 commits into
feat/thinking-capability-shapesfrom
feat/thinking-variant-apply
Aug 3, 2026
Merged

hffmnnj merged 3 commits into
feat/thinking-capability-shapesfrom
feat/thinking-variant-apply

Conversation

@hffmnnj

@hffmnnj hffmnnj commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • apply id-only thinking-level resolutions through agent.model.variant
  • preserve full-variant merging and safe unsupported-level fallback
  • replace in-place capability-map clearing with snapshot swapping
  • add V1/V2 parity, reload, wiring, and configuration regression coverage
  • document the live catalog capability shape

Verification

  • 33 thinking tests passed
  • 75 core tests passed
  • 421 hook tests passed
  • package suite: 2237 passed, 0 failed
  • typecheck, lint, and build passed

hffmnnj added 3 commits August 2, 2026 21:22
…ordering

- applyThinkingLevelsToAgents now sets agent.model.variant for honest
  string resolutions (id-only V2 matches) instead of silently discarding
  them. No headers/body are fabricated for a string apply.
- captureCatalogCapabilities builds a fresh Map per refresh and the shared
  reference is swapped only after full population, replacing the previous
  clear-then-repopulate-in-place pattern. A reentrant agent transform
  racing a catalog refresh now always observes a complete snapshot.
- registerThinkingLevelAgentTransform deduplicates the initial-registration
  and reload code paths through a shared refresh() closure; behavior is
  unchanged (catalog transform before agent transform, in both paths).

Tests: 3 new cases covering the string-apply path, the unsupported-level
warning path, and reentrancy/capture-ordering safety. All prior hooks-v2
coverage (full-variant merge, live reload rerun) passes unchanged.
Add a redacted real-shape parity fixture to dual-contract.test.ts asserting
that equivalent V1 (capabilities.reasoning + options) and real-shape V2
(reasoning + reasoning_options effort) host payloads produce the same
supported thinking-level set through the shared resolveCapabilities
extractor, and that every canonical label resolves on both contracts.

Add a defensive V1 chat.params test to agent-registration.test.ts
documenting the precise posture when the catalog exposes only the
real-shape effort options: resolveCapabilities classifies it as a V2
id-only match, getVerifiedV1RequestOption returns undefined, and the
hook emits the documented 'no unambiguous V1 request option' diagnostic
while preserving the provider default. The V2 adapter handles the same
shape via the string apply path.

agent-registration.ts is deliberately untouched: the new V1 test passes
green on first run, proving the Wave 1 shared extraction change does
not break V1. No speculative source edit (ADL Rule 4).

Verification:
- dual-contract.test.ts: 15 pass, 0 fail, 66 expect() calls
- agent-registration.test.ts: 13 pass, 0 fail, 23 expect() calls
- features/setup/: 93 pass, 0 fail, 259 expect() calls (non-regression)
- typecheck: clean; lint: 0 warnings in edited files
…real-shape catalog

Add the Pattern 4 wiring proof for the live host capability shape that
caused the original defect: a catalog publishing reasoning:true +
reasoning_options (no variants). A configured agentThinkingLevels value
for a goop-* role reaches the V2 consumer, sets agent.model.variant
without a preserve-default warning and without fabricated headers/body,
and changing the configured level changes the applied variant on reload.

Document the reasoning_options-vs-variants catalog gotcha in AGENTS.md.
@hffmnnj
hffmnnj merged commit 5f3f58b into feat/thinking-capability-shapes Aug 3, 2026
@hffmnnj
hffmnnj deleted the feat/thinking-variant-apply branch August 3, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant